<template>
  <el-form  ref="ruleFormRef" :model="formInline" :rules="formRules" label-width="auto" label-position="top" v-loading="isLoading">
    <el-row :gutter="30">

			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.id' prop='id'>
					<el-input v-model.trim='formInline.id' clearable :placeholder='prompt?.id' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.createdByName' prop='createdByName'>
					<el-input v-model.trim='formInline.createdByName' clearable :placeholder='prompt?.createdByName' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.path' prop='path'>
					<el-input v-model.trim='formInline.path' clearable :placeholder='prompt?.path' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.method' prop='method'>
					<el-input v-model.trim='formInline.method' clearable :placeholder='prompt?.method' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.content' prop='content'>
					<el-input v-model.trim='formInline.content' clearable :placeholder='prompt?.content' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.createdAt' prop='createdAt'>
					<el-input v-model.trim='formInline.createdAt' clearable :placeholder='prompt?.createdAt' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.ip' prop='ip'>
					<el-input v-model.trim='formInline.ip' clearable :placeholder='prompt?.ip' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.jsonCode' prop='jsonCode'>
					<el-input v-model.trim='formInline.jsonCode' clearable :placeholder='prompt?.jsonCode' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.httpCode' prop='httpCode'>
					<el-input v-model.trim='formInline.httpCode' clearable :placeholder='prompt?.httpCode' />
				</el-form-item>
			</re-col>    </el-row>
  </el-form>
</template>

<script setup lang="ts">
import { ref,reactive } from "vue";
import ReCol from "@/components/ReCol";
import type { FormRules } from "element-plus";
import { titles,prompt } from './index';
import type { infoType } from '@/api/manage/system-management/operation-records/index';
type FormProps = {
	formInline: infoType,
	isLoading: boolean
}

const props = withDefaults(defineProps<FormProps>(), {
	formInline: () => ({} as infoType),
	isLoading: false
});

const formRules = reactive(<FormRules>{id: [{ required: true, message: prompt?.id, trigger: 'blur' },],
createdByName: [{ required: true, message: prompt?.createdByName, trigger: 'blur' },],
path: [{ required: true, message: prompt?.path, trigger: 'blur' },],
method: [{ required: true, message: prompt?.method, trigger: 'blur' },],
content: [{ required: true, message: prompt?.content, trigger: 'blur' },],
createdAt: [{ required: true, message: prompt?.createdAt, trigger: 'blur' },],
ip: [{ required: true, message: prompt?.ip, trigger: 'blur' },],
jsonCode: [{ required: true, message: prompt?.jsonCode, trigger: 'blur' },],
httpCode: [{ required: true, message: prompt?.httpCode, trigger: 'blur' },],
});
const ruleFormRef = ref();
//    const newFormInline = ref(props.formInline as any);
//
//
//    watch(()=>props.formInline,()=>{
//    	newFormInline.value = props.formInline
//    },{
//    	deep:true,
//    	immediate:true
//    })
function getRef() {
  return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
